package com.haoyeteng.sxbd.modular.system.service.impl;

import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.haoyeteng.sxbd.core.exception.SxbdException;
import com.haoyeteng.sxbd.core.util.ToolUtil;
import com.haoyeteng.sxbd.modular.system.dao.AdminMapper;
import com.haoyeteng.sxbd.modular.system.model.Admin;
import com.haoyeteng.sxbd.modular.system.service.IAdminService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;
/**
 * <p>
 * 管理员表 服务实现类
 * </p>
 *
 * @author haoyeteng123
 * @since 2018-02-22
 */
@Service
public class AdminServiceImpl extends ServiceImpl<AdminMapper, Admin> implements IAdminService {

    @Override
    public int setStatus(Integer adminId, int status) {
        return this.baseMapper.setStatus(adminId, status);
    }

    @Override
    public int changePwd(Integer adminId, String pwd) {
        return this.baseMapper.changePwd(adminId, pwd);
    }

    @Override
    public List<Map<String, Object>> selectAdmins(Page<Admin> page, String name, String account) {
        return this.baseMapper.selectAdmins(page, name, account);
    }

    @Override
    public int setRoles(Integer adminId, String roleIds) {
        return this.baseMapper.setRoles(adminId, roleIds);
    }

    @Override
    public Admin getByAccount(String account) {
        return this.baseMapper.getByAccount(account);
    }

}
